<template>

  <div class="table1_container">
    <div class="table1_dataShower" style="padding-bottom: 50px; padding-top: 50px; box-sizing: border-box">
      <button class="report-top-button" @click="back">返回上级页面</button>
      <div style="text-align: center; margin: 10px 0;">
        <div style="display: inline-flex; gap: 20px;">
          <!-- 未完成 -->
          <div style="display: flex; align-items: center;">
            <div
              style="width: 16px; height: 16px; background-color: #ffffff; border: 1px solid #ddd; margin-right: 5px;"
            />
            <span>未完成</span>
          </div>

          <!-- 已完成 -->
          <div style="display: flex; align-items: center;">
            <div
              style="width: 16px; height: 16px; background-color: #e6f7e6; border: 1px solid #ddd; margin-right: 5px;"
            />
            <span>已完成</span>
          </div>

          <!-- 不合格重采 -->
          <div style="display: flex; align-items: center;">
            <div
              style="width: 16px; height: 16px; background-color: #ffebeb; border: 1px solid #ddd; margin-right: 5px;"
            />
            <span>不合格重采</span>
          </div>
        </div>
      </div>
      <h1>现浇结构检验批质量验收记录</h1>
      <div style="width: 90%; text-align: right; margin-bottom: 5px;">
        <span style="margin-right: 10%;">流水号:*****</span>
      </div>
      <table class="table1_reportTable">
        <tr>
          <td colspan="5"><strong>单位（子单位）<br>工程名称</strong></td>
          <td colspan="5">{{ previewData.subprojectName }}</td>
          <td colspan="5"><strong>分部（子分部）<br>工程名称</strong></td>
          <td colspan="5">{{ previewData.fenbuProjectName }}</td>
          <td colspan="5"><strong>分项工程名称</strong></td>
          <td colspan="5">{{ previewData.fenxiangName }}</td>
        </tr>
        <tr>
          <td colspan="5"><strong>施工单位</strong></td>
          <td colspan="5">{{ previewData.shigongCompanyName }}</td>
          <td colspan="5"><strong>项目负责人</strong></td>
          <td colspan="5">{{ previewData.shigongDirector }}</td>
          <td colspan="5"><strong>检验批容量</strong></td>
          <td colspan="5">{{ previewData.taskInspectBatchVolumeSources }}</td>
        </tr>
        <tr>
          <td colspan="5"><strong>分包单位</strong></td>
          <td colspan="5">{{ previewData.fenbaoCompany }}</td>
          <td colspan="5"><strong>分包单位项目<br>负责人</strong></td>
          <td colspan="5">{{ previewData.fenbaoDirector }}</td>
          <td colspan="5"><strong>检验批部位</strong></td>
          <td colspan="5">{{ previewData.inspectPart }}</td>
        </tr>
        <tr>
          <td colspan="5"><Strong>施工依据</Strong></td>
          <td colspan="10">{{ previewData.shigongRule }}</td>
          <td colspan="7"><strong>验收依据</strong></td>
          <td colspan="8">{{ previewData.yanshouRule }}</td>
        </tr>

        <tr>
          <th colspan="10">验收项目</th>
          <th colspan="3">设计要求及规范制定</th>
          <th colspan="1">样本总数</th>
          <th colspan="4">最小/实际抽样数量</th>
          <th colspan="8">检查记录</th>
          <th colspan="4">检查结果</th>
        </tr>

        <tr>
          <td rowspan="2" colspan="1">主控项目</td>
          <td colspan="1">1</td>
          <td colspan="8">外观质量</td>
          <td colspan="3">{{ previewData.mainItems[0].ruleStandard }}</td>
          <td colspan="1">{{ previewData.mainItems[0].sampleAmount }}</td>
          <td colspan="4">{{ previewData.mainItems[0].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.mainItems[0].checkRecord }}</td>
          <td colspan="4">{{ previewData.mainItems[0].passRate }}</td>
        </tr>

        <tr>
          <td colspan="1">2</td>
          <td colspan="8">影响结构性能或使用功能的尺寸偏差</td>
          <td colspan="3">{{ previewData.mainItems[1].ruleStandard }}</td>
          <td colspan="1">{{ previewData.mainItems[1].sampleAmount }}</td>
          <td colspan="4">{{ previewData.mainItems[1].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.mainItems[1].checkRecord }}</td>
          <td colspan="4">{{ previewData.mainItems[1].passRate }}</td>
        </tr>

        <tr>
          <td rowspan="21" colspan="1">一般项目</td>
          <td colspan="1">1</td>
          <td colspan="8">外观质量一般缺陷</td>
          <td colspan="3">{{ previewData.generalItems[0].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[0].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[0].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[0].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[0].passRate }}</td>
        </tr>

        <tr>
          <td rowspan="20" colspan="1">2</td>
          <td rowspan="20" colspan="1" class="rowspanStyle">现浇结构位置、尺寸允许偏差mm</td>
          <td rowspan="3" colspan="1">轴线位置</td>
          <td colspan="6">整体基础</td>
          <td colspan="3">{{ previewData.generalItems[1].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[1].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[1].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[1].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[1].passRate }}</td>
        </tr>

        <tr>
          <td colspan="6">独立基础</td>
          <td colspan="3">{{ previewData.generalItems[2].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[2].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[2].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[2].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[2].passRate }}</td>
        </tr>

        <tr>
          <td colspan="6">墙、柱、梁</td>
          <td colspan="3">{{ previewData.generalItems[3].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[3].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[3].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[3].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[3].passRate }}</td>
        </tr>

        <tr>
          <td rowspan="4" colspan="1">垂直度</td>
          <td rowspan="2" colspan="1">层高</td>
          <td colspan="5">≤6m</td>
          <td colspan="3">{{ previewData.generalItems[4].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[4].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[4].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[4].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[4].passRate }}</td>
        </tr>

        <tr>
          <td colspan="5">＞6m</td>
          <td colspan="3">{{ previewData.generalItems[5].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[5].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[5].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[5].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[5].passRate }}</td>
        </tr>

        <tr>
          <td colspan="6">全高（H）≤300m</td>
          <td colspan="3">{{ previewData.generalItems[6].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[6].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[6].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[6].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[6].passRate }}</td>
        </tr>

        <tr>
          <td colspan="6">全高（H）＞300m</td>
          <td colspan="3">{{ previewData.generalItems[7].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[7].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[7].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[7].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[7].passRate }}</td>
        </tr>

        <tr>
          <td rowspan="2" colspan="1">标高</td>
          <td colspan="6">层高</td>
          <td colspan="3">{{ previewData.generalItems[8].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[8].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[8].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[8].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[8].passRate }}</td>
        </tr>

        <tr>
          <td colspan="6">全高</td>
          <td colspan="3">{{ previewData.generalItems[9].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[9].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[9].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[9].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[9].passRate }}</td>
        </tr>

        <tr>
          <td rowspan="3" colspan="1">截面尺寸</td>
          <td colspan="6">基础</td>
          <td colspan="3">{{ previewData.generalItems[10].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[10].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[10].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[10].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[10].passRate }}</td>
        </tr>

        <tr>
          <td colspan="6">柱、梁、板、墙</td>
          <td colspan="3">{{ previewData.generalItems[11].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[11].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[11].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[11].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[11].passRate }}</td>
        </tr>

        <tr>
          <td colspan="6">楼梯相邻踏步高差</td>
          <td colspan="3">{{ previewData.generalItems[12].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[12].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[12].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[12].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[12].passRate }}</td>
        </tr>

        <tr>
          <td rowspan="2" colspan="1">电梯井</td>
          <td colspan="6">中心线位置</td>
          <td colspan="3">{{ previewData.generalItems[13].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[13].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[13].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[13].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[13].passRate }}</td>
        </tr>

        <tr>
          <td colspan="6">长、宽尺寸</td>
          <td colspan="3">{{ previewData.generalItems[14].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[14].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[14].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[14].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[14].passRate }}</td>
        </tr>

        <tr>
          <td colspan="7">表面平整度</td>
          <td colspan="3">{{ previewData.generalItems[15].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[15].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[15].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[15].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[15].passRate }}</td>
        </tr>

        <tr>
          <td rowspan="4" colspan="7">预埋件中心位置</td>
          <td colspan="1">预埋板</td>
          <td colspan="2">{{ previewData.generalItems[16].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[16].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[16].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[16].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[16].passRate }}</td>
        </tr>

        <tr>
          <td colspan="1">预埋螺栓</td>
          <td colspan="2">{{ previewData.generalItems[17].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[17].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[17].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[17].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[17].passRate }}</td>
        </tr>

        <tr>
          <td colspan="1">顶埋管</td>
          <td colspan="2">{{ previewData.generalItems[18].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[18].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[18].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[18].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[18].passRate }}</td>
        </tr>

        <tr>
          <td colspan="1">其他</td>
          <td colspan="2">{{ previewData.generalItems[19].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[19].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[19].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[19].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[19].passRate }}</td>
        </tr>

        <tr>
          <td colspan="7">预留洞、孔中心线位置</td>
          <td colspan="3">{{ previewData.generalItems[21].ruleStandard }}</td>
          <td colspan="1">{{ previewData.generalItems[21].sampleAmount }}</td>
          <td colspan="4">{{ previewData.generalItems[21].minAndCollectedAmount }}</td>
          <td colspan="8">{{ previewData.generalItems[21].checkRecord }}</td>
          <td colspan="4">{{ previewData.generalItems[21].passRate }}</td>
        </tr>


        <tr id="table1_reportTable_bottom">
          <td rowspan="3" colspan="7" style="border-right: 1px solid black">施工单位<br>检查结果</td>
          <td rowspan="3" colspan="13">主控项目全部合格，一般项目满足规范要求，本检验批合格</td>
          <td colspan="10" style="text-align: left">专业工长（施工员）：</td>
        </tr>
        <tr id="table1_reportTable_bottom">
          <td colspan="10" style="text-align: left">项目专业质量检查员：</td>
        </tr>
        <tr id="table1_reportTable_bottom">
          <td colspan="10" style="text-align: right"><span style="letter-spacing: 2em">年月日</span></td>
        </tr>

        <tr id="table1_reportTable_bottom" style="border-top: 1px solid black">
          <td rowspan="3" colspan="7" style="border-right: 1px solid black">监理（建设单位）<br>验收结论</td>
          <td rowspan="3" colspan="13">同意验收</td>
          <td colspan="10" style="text-align: left">专业监理工程师</td>
        </tr>
        <tr id="table1_reportTable_bottom">
          <td colspan="10" style="text-align: left">（建设单位项目专业负责人）：</td>
        </tr>
        <tr id="table1_reportTable_bottom">
          <td colspan="10" style="text-align: right"><span style="letter-spacing: 2em">年月日</span></td>
        </tr>

      </table>
    </div>

    <div>
      <h1>{{ json }}</h1>
      <br><br>
      <h1>{{ jsonParse }}</h1>
    </div>

  </div>


</template>

<script>

/*
 *    这个报表真麻烦！！！
 *
 */

export default {
  name: 'NoZoomPage',
  data() {
    return {
      localStorageId: '',
      reportData: {},
      previewData: {},
      originalViewport: '',
      json: '',
      jsonParse: {}
    }
  },
  async mounted() {  //钩子函数

    // //保存原始viewport数据
    // const viewportMeta = document.querySelector('meta[name=viewport]');
    // this.originalViewport = viewportMeta.content;
    //
    // viewportMeta.content = "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no";
    //
    // window.addEventListener("keydown", this.preventZoom);
    // window.addEventListener("wheel", this.preventZoom, { passive: false });  //监听键盘事件

    //从localstorage中拿数据
    const localStorageId = this.$route.query.localStorageId
    this.localStorageId = localStorageId // 保存id用于销毁时清理
    if (localStorageId) {
      const data = localStorage.getItem(localStorageId)
      if (data) {
        this.reportData = JSON.parse(data)
        console.log(this.reportData)
      }
    }

    //赶紧从接口拿数据
    // try {
    //   const { result } = await searchInpsectCheckPreview(this.reportData.taskId);
    //   console.log(result);
    //   this.previewData = result
    //   console.log(this.previewData);
    //   this.$message.success('报表已生成！');
    // }catch(err){
    //   this.$message.error('报表生成失败！');
    // }

    this.previewData = {
      'subprojectName': '保利心语佳苑1#楼',
      'fenbuProjectName': '主体结构分部-混凝土结构子分部',
      'fenxiangName': '现浇结构分项',
      'shigongCompanyName': '中国建筑第五工程局有限公司',
      'shigongDirector': '施工单位项目负责人1',
      'taskInspectBatchVolumeSources': '钢筋2批(10E，12E)、钢筋3批(8E，8E，8E)',
      'fenbaoCompany': '河南建工集团',
      'fenbaoDirector': '李四',
      'inspectPart': '-2层1施工段墙柱',
      'shigongRule': '《棱镜公司施工规范》LG-2025',
      'yanshouRule': 'GB50204-2015《混凝土结构工程施工质量验收规范》',
      'streamNumber': 'PC012020102010233',
      'generalItems': [
        {
          'itemName': '钢筋力学性能和重量偏差检验',
          'ruleStandard': '第5.2.1条',
          'sampleAmount': '2',
          'minAndCollectedAmount': '全/2',
          'checkRecord': '合格合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '成型钢筋力学性能和重量偏差检验',
          'ruleStandard': '第5.2.2条',
          'sampleAmount': '/',
          'minAndCollectedAmount': '/',
          'checkRecord': '/',
          'passRate': '/',
          'isFinished': 1
        },
        {
          'itemName': '抗震用钢筋强度实测值',
          'ruleStandard': '第5.2.3条',
          'sampleAmount': '1',
          'minAndCollectedAmount': '全/1',
          'checkRecord': '合格合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋化学成分检验',
          'ruleStandard': '第5.2.4条',
          'sampleAmount': '2',
          'minAndCollectedAmount': '全/2',
          'checkRecord': '合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋焊接接头力学性能检验',
          'ruleStandard': '第5.2.5条',
          'sampleAmount': '3',
          'minAndCollectedAmount': '全/3',
          'checkRecord': '合格合格合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋机械连接接头力学性能检验',
          'ruleStandard': '第5.2.6条',
          'sampleAmount': '2',
          'minAndCollectedAmount': '全/2',
          'checkRecord': '合格合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋锚固性能检验',
          'ruleStandard': '第5.2.7条',
          'sampleAmount': '1',
          'minAndCollectedAmount': '全/1',
          'checkRecord': '合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋弯曲性能检验',
          'ruleStandard': '第5.2.8条',
          'sampleAmount': '2',
          'minAndCollectedAmount': '全/2',
          'checkRecord': '合格合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋反向弯曲性能检验',
          'ruleStandard': '第5.2.9条',
          'sampleAmount': '1',
          'minAndCollectedAmount': '全/1',
          'checkRecord': '合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋疲劳性能检验',
          'ruleStandard': '第5.2.10条',
          'sampleAmount': '/',
          'minAndCollectedAmount': '/',
          'checkRecord': '/',
          'passRate': '/',
          'isFinished': 1
        },
        {
          'itemName': '钢筋应力松弛性能检验',
          'ruleStandard': '第5.2.11条',
          'sampleAmount': '/',
          'minAndCollectedAmount': '/',
          'checkRecord': '/',
          'passRate': '/',
          'isFinished': 1
        },
        {
          'itemName': '钢筋焊接网力学性能检验',
          'ruleStandard': '第5.2.12条',
          'sampleAmount': '2',
          'minAndCollectedAmount': '全/2',
          'checkRecord': '合格合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋焊接骨架力学性能检验',
          'ruleStandard': '第5.2.13条',
          'sampleAmount': '1',
          'minAndCollectedAmount': '全/1',
          'checkRecord': '合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋焊接接头外观质量检验',
          'ruleStandard': '第5.2.14条',
          'sampleAmount': '3',
          'minAndCollectedAmount': '全/3',
          'checkRecord': '合格合格合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋机械连接接头外观质量检验',
          'ruleStandard': '第5.2.15条',
          'sampleAmount': '2',
          'minAndCollectedAmount': '全/2',
          'checkRecord': '合格合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋绑扎搭接接头质量检验',
          'ruleStandard': '第5.2.16条',
          'sampleAmount': '1',
          'minAndCollectedAmount': '全/1',
          'checkRecord': '合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋锚固长度检验',
          'ruleStandard': '第5.2.17条',
          'sampleAmount': '2',
          'minAndCollectedAmount': '全/2',
          'checkRecord': '合格合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋保护层厚度检验',
          'ruleStandard': '第5.2.18条',
          'sampleAmount': '3',
          'minAndCollectedAmount': '全/3',
          'checkRecord': '合格合格合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋间距检验',
          'ruleStandard': '第5.2.19条',
          'sampleAmount': '2',
          'minAndCollectedAmount': '全/2',
          'checkRecord': '合格合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋直径检验',
          'ruleStandard': '第5.2.20条',
          'sampleAmount': '1',
          'minAndCollectedAmount': '全/1',
          'checkRecord': '合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋表面质量检验',
          'ruleStandard': '第5.2.21条',
          'sampleAmount': '2',
          'minAndCollectedAmount': '全/2',
          'checkRecord': '合格合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋锈蚀程度检验',
          'ruleStandard': '第5.2.22条',
          'sampleAmount': '1',
          'minAndCollectedAmount': '全/1',
          'checkRecord': '合格',
          'passRate': '100%',
          'isFinished': 1
        }
      ],
      'mainItems': [
        {
          'itemName': '钢筋外观质量',
          'ruleStandard': '第5.2.4条',
          'sampleAmount': '2',
          'minAndCollectedAmount': '全/2',
          'checkRecord': '合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '成型钢筋外观质量和尺寸偏差',
          'ruleStandard': '第5.2.5条',
          'sampleAmount': '2',
          'minAndCollectedAmount': '全/2',
          'checkRecord': '合格',
          'passRate': '100%',
          'isFinished': 2
        },
        {
          'itemName': '钢筋机械连接套筒、锚固板及预埋件等外观质量',
          'ruleStandard': '第5.2.6条',
          'sampleAmount': '1',
          'minAndCollectedAmount': '全/1',
          'checkRecord': '合格',
          'passRate': '100%',
          'isFinished': 1
        },
        {
          'itemName': '钢筋安装位置偏差',
          'ruleStandard': '第5.2.7条',
          'sampleAmount': '3',
          'minAndCollectedAmount': '全/3',
          'checkRecord': '合格合格合格',
          'passRate': '100%',
          'isFinished': 1
        }
      ],
      'finishDate': [
        '2025',
        '05',
        '01'
      ]
    }

    this.json = {
      'code': 28,
      'msg': 'sint consequat ut',
      'data': {
        'total': 30,
        'rows': [{
          'id': 88,
          'username': '菅若汐',
          'password': 'U_kfLD1eykUyNcV',
          'name': '校成',
          'gender': 98,
          'job': 27,
          'salary': 59,
          'image': 'https://loremflickr.com/400/400?lock=4696047556092085',
          'entryDate': '2026-05-11',
          'deptId': 7,
          'deptName': '留雯静',
          'createTime': '2025-11-03 02:12:10',
          'updateTime': '2024-12-08'
        }]
      }
    }

    this.jsonParse = JSON.parse(this.json.code)

  },
  beforeDestroy() { //离开页面要做的事

    window.removeEventListener('keydown', this.preventZoom)
    window.removeEventListener('wheel', this.preventZoom)   //取消监听

    const viewportMeta = document.querySelector('meta[name=viewport]')
    if (viewportMeta) {
      viewportMeta.content = this.originalViewport
    }

    //那就是清除localstorage！！！
    if (this.localStorageId) {
      localStorage.removeItem(this.localStorageId)
    }
    document.querySelector('body').setAttribute('style', 'background-color: white;') //还原，因为这是个全局样式

  },
  beforeCreate() {
    document.querySelector('body').setAttribute('style', 'background-color:#f5f5f5;') //设置对比色
  },
  methods: {
    back() {
      this.$router.go(-1)
    },
    preventZoom(e) {
      // // 阻止 Ctrl + 滚轮
      // if (e.ctrlKey || e.metaKey) {
      //   e.preventDefault();
      // }
      // // 阻止 Ctrl + +/-
      // if ((e.ctrlKey || e.metaKey) && (e.key === '+' || e.key === '-' || e.key === '=')) {
      //   e.preventDefault();
      // }
    }
  }
}
</script>

<style>

/*
先来设置每个任务项对应的背景颜色吧！
 */
.row-unfinished {
  background-color: #ffffff; /* 未完成 - 白色或默认色 */
}

.row-finished {
  background-color: #e6f7e6; /* 已完成 - 浅绿色 */
}

.row-failed {
  background-color: #ffebeb; /* 不合格重采 - 浅红色 */
}

.table1_container {
  width: 80%;
  background: white;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  padding-bottom: 20px;
}

.table1_dataShower {
  width: 90%;
  background: white;
  margin: 0 auto;
  border: 2px black solid;
}

/*这是返回按钮的样式*/
.report-top-button {
  display: block;
  margin: 0 auto;
  margin-bottom: 20px;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Arial', sans-serif;
  color: #ffffff;
  background: linear-gradient(90deg, #1e3a8a, #3b82f6); /* 建筑行业蓝色调，稳重且有活力 */
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.report-top-button:hover {
  background: linear-gradient(90deg, #1e3a8a, #2563eb);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.report-top-button:active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transform: translateY(0);
}

.table1_reportTable {
  width: 90%;
  margin: 0 auto;
  border-collapse: collapse;
  border: 1px solid black;
  table-layout: fixed;
}

.table1_reportTable tr td, .table1_reportTable tr th {
  border: 1px solid black;
  height: 70px;
}

#table1_reportTable_bottom td {
  border: none;
  height: 50px !important;
}

.rowspanStyle {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

th {
  box-sizing: border-box !important;
}
</style>
